<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>樊文帅购物车</title>
<link rel="stylesheet" href="./Public/Home/css/gouwu.css" />
<link rel="stylesheet" href="icoupont/icoufont.css" />
<script type="text/javascript" src="./Public/Home/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="./Public/Home/js/1.js"></script>



</head>
<body>
     <!-- 最顶部 -->
 <div id="head">
        <!-- content内容 -->
 	<div class="content">
      <!-- 最顶部右边   -->
      <a class="home" href="" style="line-height: 30px;">蘑菇街首页</a>
        <ul class="right"> 
            <li class="ri right_a "><a href="">注册</a></li>
            <li class="ri right_a "><a href="">登录&nbsp;|</a></li>
            <li class="ri right_b "><a href="">我的订单&nbsp;|</a></li>
            <li class="ri right_c ">
                    <a href="">|</a>
                    <div class="gou">
                      <span class="gouwu"></span>
                       购物车
                    </div>
                    <div class="wu">购物车里没有商品！</div>
            </li>
            <li class="ri right_d ">
                   <a  class="kf"href="">客服服务&nbsp;|</a>
                   <i class="icon_daita"></i>
                   <div class="box">
                       <a class=" ll ">联系</a>
                       <a class=" bz ">帮助</a>
                   </div>
            </li>
            <li class="ri right_e ">
                <a href="">我的小店</a>
            </li>
        </ul>
    </div>
 </div>
 <div class="da_b">
<!--二楼开始-->
<!--大的div-->
<div id="c">
	<!--中间div1200-->
	<div class="z">
		<!--左边div-->
	<div class="y">
		<a href=""><img src="./Public/Home/images/wd.png"/></a>
	</div>
	<!--右边div-->
	<div class="you">
		<div class="you_bg">
			<div class="jindu" ></div>
			<i class="i i_a">
			1
				<span class="tip">购物车</span>
			</i>
			<i class="i i_b">
				2
				<span class="tip">确认订单</span>
			</i>
			<i class="i i_c">
				3
				<span class="tip">支付</span>
			</i>
			<i class="i i_d">
				4
				<span class="tip">完成</span>
			</i>
		</div>
		
	</div>
</div>
	
</div>

<!---------------------------------------------三楼开始---------------------------------------------------->
<form action="" method="post">
<div class="da"style=" width:1200px;height: 100%;margin: 0 auto;">
	

<!--大的div-->
<div class="san">
	<!--头部div-->
	<div class="tou">
		<ul>
			<li class="pd">
				<a href="javascript:;">
					全部商品（<span class="num">1</span>）
			    </a>
			</li>
			<li class="a">|</li>
			<li class="p">
			<a href="javascript:;">
					全部商品（<span class="num">0</span>）
				 </a>
			</li>
				<li class="a">|</li>
			<li class="p">
			<a href="javascript:;">
					全部商品（<span class="num">0</span>）
			 </a>
			</li>
		</ul>
	</div>
	
	
	<div class="zj">
		<div class="zj_a">
			<input class="tr"type="checkbox" name="" value="" />
			<ul class="pian">
			<li class="quan">全选</li>
			<li class="wrop">商品</li>
			<li class="wrop_a">商品信息</li>
			<li class="wrop_c">单价(元)</li>
			<li class="wrop_b">数量</li>
			<li class="wrop_b">小计(元)</li>
			<li >操作</li>
			</ul>
		</div>
			

		<!--三层-->
		
		<div class="zj_c">
			<?php foreach ($data['goods'] as $vv){?>
			<div class="a_a">
				<input class="tr"type="checkbox" name="" value="" />
				<div class="zt">
					<a class="zt_a"href=""><?php echo $vv['name']?></a>
				</div>
		     </div>
		     <!--颜色-->
		     <div class="li">
		     	<li>
					<p class="p">颜色：<?php echo $vv['options']['color']?></p>
					<p class="p">尺码：<?php echo $vv['options']['size']?></p>
				</li>
		     </div>
		     <!--物品的价格-->
		     <div class="shu">
		     	<li>
					<!--!--物品的价格-->
					<p class="p1"><?php echo $vv['price']?></p>
				</li>
		     </div>
		     	<div>
		     		<div class="num_a">
		             	<!--数量的减-->
						<span class="num_reduce num_disable jian"></span>
						
						<input  class="num_input"type="text" name="" id="" value="<?php echo $vv['num']?>" />
						<!--数量的加-->
						<span class="num_add jia"></span>	
					</div>
				
					<!--//小计的价格-->
					<div class="p_s">
						<p class="p_a"><?php echo $vv['price']?></p>
					</div>
					<div class="p_c">
						<a href=""class="p_a">删除</a>
					</div>
				</div>
				<?php }?>	
		</div>
		<!--总价格就是单价*个数的积       总价格是（total）= 商品的单价（price）*商品的总数（num）-->
		  <script type="text/javascript">
			$(function(){
//				p($data);
				//减的js
				$('.jian').click(function(){
                              //先抓取商品的单价。在抓取商品的个数，两个的乘积赋给商品的小计
					var num=parseInt($(this).siblings('.num_input').val());
					if(num>1){
						num--;
                             //商品的个数
						$(this).siblings('.num_input').val(num);
						var onemoney=parseInt($(this).parents('.zj_c').find('.p1').html());
                             //这步是商品小计的价格=个数*单价
						var total=num*onemoney;
						$(this).parent().siblings('.p_s').find('.p_a').html(total);
						//这是
						$('.you_a span').html(num);
						$('.q').html('￥'+total);
					}
				})
                     //加的js
				$('.jia').click(function(){
					var num=parseInt($(this).siblings('.num_input').val());
                    //商品的个数加
					num++;
					$(this).siblings('.num_input').val(num);
					var onemoney=parseInt($(this).parents('.zj_c').find('.p1').html());
					var total=num*onemoney;
					$(this).parent().siblings('.p_s').find('.p_a').html(total);
					
					$('.you_a span').html(num);
					$('.q').html('￥'+total);
					
				})
                    //商品的总价
                               
				$('.num_input').change(function(){
					alert()
					$(this).siblings('.you').val(num);
					var num=parseInt($(this).siblings('.you_a').val());
					var onemoney=$(this).attr('price');
					var total=nums*onemoney;
					$(this).parent().siblings('.qi').find('.q').html(total);
				})
			})		
		  </script>
	</div>
	<script type="text/javascript">
	//删除商品的代码
		$(function(){
			$('.del').click(function(){
				var del=$(this).attr('del');
				$.ajax({
					type:"post",
					//跳转的路径
					url:"<?php echo U('del')?>",
					//这个是异步上传的东西
					data:{del : del},
					dataType:'json',
					success:function(phpData){
		            if(phpData=1){}
					}
				});
			})
		})
</script>
		
	<div class="di">
		<div class="a_a">
				<input class="tr"type="checkbox" name="" value="" />
				<lable class="mr10" for="s_all_f">全选</lable>
				<a class="sc"href="javascript:;"data-ptp-idx="42">删除</a>
				<a class="sc del"href="javascript:;"data-ptp-idx="42" del="1">清空失效商品</a>	
	    </div>
	<div class="you">
		<div class="you_a">
			共有
			<span><?php echo $data['total_rows']?></span>
			件商品,总计:
		</div>
		<div class="q">
			<span class="q qi">￥<?php echo $data['total']?></span>
		</div>
		<a href="<?php echo U('Carte/index')?>">
		<div class="s"></div>
		</a>
	  </div>
   </div>
 </div>
 	
 </div>  
</form>

<!--dibu开始-->
<div class="dibu">
	<p>
		<a href="http://www.mogujie.com" target="_blank">蘑菇街</a>
		|
		<a href="http://www.mogujie.com/joinin"target="_blank">加入开放平台</a>
		<a href=""> © 2016 Mogujie.com,All Rights Reserved.</a>
	</p>
	<div class="icon">
		<a class="vc" target="_blank"href="javascript:;"></a>
		<a class="va"target="_blank"href="javascript:;"></a>
		<a class="vb"target="_blank"href="javascript:;"></a>
		<a class="vd"target="_blank"href="http://bank.pingan.com/index.shtml"></a>
		<a class="vf"target="_blank"href="https://ss.knet.cn"></a>
		<a class="vg"target="_blank"href="http://www.pingpinganan.gov.cn/"></a>
	</div>
</div>

</div>


